<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta content="yes" name="apple-mobile-web-app-capable" />
<meta content="black" name="apple-mobile-web-app-status-bar-style" />
<meta content="telephone=no" name="format-detection" />
<meta content="email=no" name="format-detection" />
<title>工单列表图</title>
<link rel="stylesheet" href="../../css/s_plus.css" />
<link rel="stylesheet" href="../../css/base.css" />
<link rel="stylesheet" href="../../css/layout.css" />
<link rel="stylesheet" href="../../css/choice.css" />
<script type="text/javascript" src="../../libs/vue.js" ></script>
<script type="text/javascript" src="../../js/jquery.1.9.1.min.js" ></script>
<script type="text/javascript" src="../../js/app/url.js" ></script>
<script type="text/javascript" src="../../libs/hui.js" ></script>
<script type="text/javascript" src="../../js/md5.js"></script>

<script type="text/javascript" src="../../js/app/api.js"></script>
<!--<script type="text/javascript" src="menu.js"></script>-->
</head>
<body>
	<div id="wrapper">
<header class="f_l maxbox subhead">
  <a class="back" @click="back"><i class="iconfont">&#xe605;</i></a>
  <h1>工单列表图</h1>
</header>
<section class="f_l maxbox job_list_img">
  <ul>
    <li>
      <a>
        <em>待处理工单</em>
        <b>{{ready}}</b>
      </a>
    </li>
    <li>
      <a>
        <em><span class="red">今日</span>处理工单</em>
        <b>{{today}}</b>
      </a>
    </li>
    <li>
      <a>
        <em><span class="red">昨日</span>处理工单</em>
        <b>{{yesterday}}</b>
      </a>
    </li>
    <li>
      <a>
        <em><span class="red">本月</span>处理工单</em>
        <b>{{thisMonth}}</b>
      </a>
    </li>
  </ul>
</section>
</div>
<script>
	
		//动态插入公用菜单JS
	var menuJsPath = "../work/menu.js?time=";
	 var randomh=Math.random();
     var e = document.getElementsByTagName("script")[0];
     var d = document.createElement("script");
     d.src = menuJsPath+randomh+"";
     d.type = "text/javascript"; 
     d.async = true;
     d.defer = true;
     e.parentNode.insertBefore(d,e);

	
	var sp = new Vue({
		el:"#wrapper",
		data:{
			today:0,
			yesterday:0,
			thisMonth:0,
			ready:0
		},
		methods:{
			back:function(){
				hui.back();
			},
			add:function(){
							var timestamp=new Date().getTime();
							hui.open("risk_add.html?date="+timestamp, {}, true, {});

			}
		}
	});
	
	loadDetail();
		
			function loadDetail(){
			
			  	var username=	localStorage.getItem("username");
					var sec= localStorage.getItem("sec_pwd");
			  	var time = apiManage.getNow();
			  	var key = "loginName="+username+"&passWord="+sec+"&time="+time;
				   var path = urlManager.work_total();
				  var paramKey = hex_md5(key);
                  console.log("key--"+key);       
                  console.log("paramKey--"+paramKey);

				 $.ajax({
		         type: "GET",
		         url: path,
		         beforeSend: function(request) {
		            request.setRequestHeader("loginName",username);
		            request.setRequestHeader("time",time);
		            request.setRequestHeader("sign",paramKey);
		            request.setRequestHeader("Content-Type","application/text");
		
		         },
		         success: function(result) {
	
		         	
		          	console.log("工单统计:"+JSON.stringify(result));
										sp.today=result.count1;
			  						sp.yesterday=result.count2;
										sp.thisMonth=result.count3;
										sp.ready=result.count4;

						}		 
		             
		         
		     });
				  
			}
	      
	
	
</script>
</body>
</html>